package br.webcrawler.activities.webcrawler.logs;


import br.webcrawler.activities.webcrawler.utils.FileManager;

import java.io.File;
/**
 *
 * @author Gerson Groth
 */
public class Logger {   
//    private Logs logs = new Logs();

   private FileManager fileManager = new FileManager();
   private String LOGS_PATH = "";
   private final String fileName = "/logs.txt";
    
   public Logger(){
        File dir = new File("data");  
        LOGS_PATH = dir.getAbsolutePath() + fileName;
        boolean result = dir.mkdirs();  
   }
   
    public void log(String message){
        System.out.println(message);
        try{
            fileManager.escrever(message, LOGS_PATH);
        }catch(Exception e){}
    }    
}
